<ion-view view-title="店铺首页" class="storeHome" hide-nav-bar="true">
	<div class="headerBar">
		<div class="bgImg" ng-class="{'bgImg-ios':isIOSApp()}">
			<div class="row searchRow item-input">
				<div class="imgCol mr20" on-tap="back()">
					<img src="img/guilin/brand/back.icon@2x.png"/>
				</div>
				<div class="col padding-0">
					<form action="javascript:return false;" ng-submit="doSearch('key')"><!--必须加anction属性，否则会ios上没有效果 -->
						<input type="search" placeholder="关键字" class="input" ng-model="input.key">
						<!--<input type="submit" style="display: none;" ng-click="doSearch('key')" />-->
					</form>
				</div>
				<div class="imgCol ml20" on-tap="openModal_share()">
					<img src="img/guilin/common/icon_share@2x.png" />
				</div>
			</div>
			
			<div class="storeDiv">
				<img src="{{datas.logo}}" class="sellerAvatarPng" on_tap="onshow_subfoot(1,datas.store_id)"/>
				<div class="storeNameDiv level">
					<div class="storeName">{{datas.store_name}}<span class="storeType">{{datas.store_type}}</span></div>
					<div class="shop_grade grade{{datas.store_level}}" style="margin-left: -5px;margin-top: -5px;"></div><!--星级-->
					<div class="region">{{datas.region}}</div>
				</div>
				<div class="rightDiv">
					<div class="fansDiv">
						{{datas.fav_count}}
						<p style="font-size: 10px;">粉丝数</p>
					</div>
					<div class="btnsDiv">
						<div class="btn" ng-show="!datas.is_favorite" on-tap="add_favorite()">收藏</div>
						<div class="btn" ng-show="datas.is_favorite">已收藏</div>
						<div class="btn" ng-show="datas.store_type=='加盟店'&&datas.is_friend==3&&datas.fri_flag==true" on-tap="add_friend()">加好友</div>
						<div class="btn" ng-show="datas.store_type=='加盟店'&&datas.is_friend==1&&datas.fri_flag==true">已好友</div>
						<div class="btn" ng-show="datas.store_type=='加盟店'&&datas.is_friend==0&&datas.fri_flag==true" on-tap="add_friend()">待同意</div>
						<div class="btn" ng-show="datas.store_type=='加盟店'&&datas.is_friend==2&&datas.fri_flag==true" on-tap="add_friend()">拒绝</div>
					</div>
				</div>
			</div>
		</div>
		
		<div class="row top">
			<div class="col" on-tap="activeSlide(0)" ng-class="selectIndex==0?'top-activated':''">
				店铺首页
			</div>
			<div class="col" on-tap="activeSlide(1)" ng-class="selectIndex==1?'top-activated':''">
				全部商品
			</div>
		</div>
	</div>
	
	<!--主体-->
	<ion-side-menus>
		<ion-side-menu-content>
			<ion-content scroll="false" class="bg">
				<ion-slide-box delegate-handle="main-handle" on-slide-changed="slideChanged(index)" active-slide="slideIndex" show-pager="false" on-touch="onTouch()" on-release="onRelease()">
					<!--店铺首页-->
					<ion-slide>
						<ion-scroll direction="y" ng-style="t_myObj1" lazy-scroll>
							<!--描述：下拉刷新-->
							<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
							<!-- 优惠券 -->
							<div style="background-color: white;" ng-if="datas.coupons.length>0">
								<div class="couponList" id="couponList">
									<div class="coupon" ng-repeat="coupon in datas.coupons" on-tap="get_coupon(coupon.cpns_id)">
										<div class="moneyDiv">
											<span class="unit">¥ </span>{{coupon.amount}}
										</div>
										<div class="condition">满{{coupon.conditions}}元使用</div>
										<div class="time">{{coupon.termofvalidity}}</div>
									</div>
									<!--<div class="coupon">
										<div class="moneyDiv">
											<span class="unit">¥ </span>50
										</div>
										<div class="condition">满99.00元使用</div>
										<div class="time">2018.09.08-2018.9.10</div>
									</div>-->
								</div>
							</div>
							
							<!--分类模板 style="color: {{datas.color}};"  style="background-color:{{datas.color}}"-->
							<div class="goodsList" ng-repeat="cat in datas.cat_goods">
								<div class="titleDiv">
									<div class="bgBefore"></div>
									{{cat[0].cat_name}}<span class="more"  on-tap="showMore(3,cat[0].cat_id)">更多&nbsp;<i class="icon ion-chevron-right"></i></span>
								</div>
								<div class="goodsDiv" ng-repeat="goods in cat[0].goods" ng-if="$index <6" on-tap="go_productdetail(goods.goods_id)">
									<div class="imgDiv">
										<img src="{{goods.image_default_id.url||noImg}}"/>
									</div>
									<div class="goodsNameDiv">
										<div class="name ellipsis-2">{{goods.name}}</div>
										<p class="goodsprice">{{goods.price||goods.mktprice|currency:"¥"}}</p>
									</div>
								</div>
							</div>
							
							<!--品牌模板-->
							<div class="goodsList" ng-repeat='brand in datas.brand_goods'>
								<div class="titleDiv">
									<div class="bgBefore"></div>
									{{brand[0].brand_name}}<span class="more" ng-if="brand[0].goods.length>6" on-tap="showMore(1,brand[0].goods[0].brand_id)">更多&nbsp;<i class="icon ion-chevron-right"></i></span>
								</div>
								<div class="goodsDiv" ng-repeat="goods in brand[0].goods" on-tap="go_productdetail(goods.goods_id)">
									<div class="imgDiv">
										<img src="{{goods.image_default_id.url||noImg}}"/>
									</div>
									<div class="goodsNameDiv">
										<div class="name ellipsis-2">{{goods.name}}</div>
										<p class="goodsprice">{{goods.price||goods.mktprice|currency:"¥"}}</p>
									</div>
								</div>
							</div>
							
							<!--标签模板-->
							<div class="goodsList" ng-repeat='tag in datas.tag_goods'>
								<div class="titleDiv">
									<div class="bgBefore"></div>
									{{tag[0].tag_name}}<span class="more" ng-if="tag[0].goods.length>6" on-tap="showMore(2,tag[0].goods[0].tag_id)">更多&nbsp;<i class="icon ion-chevron-right"></i></span>
								</div>
								<div class="goodsDiv" ng-repeat="goods in tag[0].goods" on-tap="go_productdetail(goods.goods_id)">
									<div class="imgDiv">
										<img src="{{goods.image_default_id.url||noImg}}"/>
									</div>
									<div class="goodsNameDiv">
										<div class="name ellipsis-2">{{goods.name}}</div>
										<p class="goodsprice">{{goods.price||goods.mktprice|currency:"¥"}}</p>
									</div>
								</div>
							</div>

							<!--推荐商品-->
							<div class="goodsList" ng-if="datas.recommend">
								<div class="titleDiv">
									<div class="bgBefore"></div>
									推荐商品<!--<span class="more" on-tap="activeSlide(1,1,brand[0].goods[0].brand_id,1)">更多&nbsp;<i class="icon ion-chevron-right"></i></span>-->
								</div>
								<div class="goodsDiv" ng-repeat="goods in datas.recommend" ng-if="$index <6" on-tap="go_productdetail(goods.goods_id)">
									<div class="imgDiv">
										<img src="{{goods.image.url||noImg}}"/>
									</div>
									<div class="goodsNameDiv">
										<div class="name ellipsis-2">{{goods.name}}</div>
										<p class="goodsprice">{{goods.price||goods.mktprice|currency:"¥"}}</p>
									</div>
								</div>
							</div>
							<ion-infinite-scroll ng-if="!isLoad" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
						</ion-scroll>
					</ion-slide>


					<!--全部商品-->
					<ion-slide>
						<div class="orderBar">
							<div class="row">
								<div class="col" on-tap="orderByCount()" ng-class="{'active':order==2||order==3}">
									销量&nbsp;
									<i class="icon ion-ios-arrow-up paixu_top" ng-class="{'gray':order==2}"></i>
									<i class="icon ion-ios-arrow-down paixu_bottom" ng-class="{'gray':order==3}"></i>
								</div>
								<div class="col" on-tap="orderByPrice()" ng-class="{ 'active':order==4||order==5}">
									价格&nbsp;
									<i class="icon ion-ios-arrow-up paixu_top" ng-class="{ 'gray':order==5}"></i>
									<i class="icon ion-ios-arrow-down paixu_bottom" ng-class="{ 'gray':order==4}"></i>
								</div>
								<div class="col" on-tap="switchGoodsStyle()">
									<img src="{{isGoodsList?'./img/guilin/other/icon_pic.png':'./img/guilin/other/icon_list.png'}}" class="scanmode" />
								</div>
								<div class="filterCol" on-tap="rightSideMenu()">
									筛选<img class="filter_icon" src="./img/guilin/other/icon_filter@2x.png" width="15"/>
								</div>
							</div>
						</div>

						<ion-scroll direction="y" ng-style="t_myObj2" lazy-scroll>
							<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
								<!--没有数据-->
								<div class="noData" ng-if="goods.goods==null||goods.goods.length==0">
									<img src="./img/guilin/other/icon_spw@2x.png" />
									<div class="tip">抱歉，没有找到商品~</div>
								</div>
								
							<!--图片模式-->
							<div class="goodsList" ng-if="!isGoodsList">
								<div class="goodsDiv" ng-repeat="goods in goods.goods" on-tap="go_productdetail(goods.goods_id)">
									<div class="imgDiv">
										<img src="{{goods.image.url||noImg}}"/>
									</div>
									<div class="goodsNameDiv">
										<div class="name ellipsis-2">{{goods.name}}</div>
										<div class="goodsprice">
											{{goods.price||goods.mktprice|currency:"¥"}}
											<span class="salescount right-zhang">月销售量:{{goods.salenumber}}</span>
											<!--<img src="{{goods.is_fav?'./img/guilin/other/icon_scdown@2x.png':'./img/guilin/other/icon_sc@2x.png'}}" class="scImg" on-tap="goods_add_favorite($index,goods.goods_id,$event)"/>-->
										</div>
									</div>
								</div>
							</div>

							<!--列表模式-->
							<div class="list" ng-if="isGoodsList">
								<li class="item goodsItem" ng-repeat="goods in goods.goods" on-tap="go_productdetail(goods.goods_id)">
									<img src="{{goods.image.url||noImg}}" class="goodsImg"/>
									<div class="goodsDiv">
										<div class="name ellipsis-2">{{goods.name}}</div>
										<div class="priceDiv">
											<p class="goodsprice" style="margin-top: 0;">{{goods.price||goods.mktprice|currency:"¥"}}</p>
											<div class="salescount">
												月销售量:{{goods.salenumber}}
												<img src="{{goods.favorite == 1?'./img/guilin/other/icon_scdown@2x.png':'./img/guilin/other/icon_sc@2x.png'}}" class="scImg" on-tap="goods_add_favorite($index,$event)"/>
											</div>
										</div>
									</div>
								</li>
							</div>
							<ion-infinite-scroll ng-if="!isLoad" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
						</ion-scroll>
					</ion-slide>

				</ion-slide-box>
			</ion-content>

			<!--底部3个菜单-->
			<div class="bar bar-footer">
				<div class="row padding-0 text-center">
					<div class="col padding-0" on_tap="openModal_aboutus()">
						<p class="bottom_item">关于我们</p>
					</div>
					<div class="lineDiv"></div>
					<div class="col padding-0" on_tap="onshow_subfoot(2,datas.store_id)">
						<p class="bottom_item">店铺公告</p>
					</div>
					<div class="kefuCol" on_tap="openModal_customer()">
						<img src="img/guilin/other/icon-chat.png" />
						<p class="kefu">客服</p>
					</div>
				</div>
			</div>
		</ion-side-menu-content>


		<!-- 右侧菜单 -->
		<ion-side-menu side="right">
			<div class="list menu">
					<div class="item item-input item-select" data-tap-disabled="true" style="font-size:16px;padding:0 30px 0 10px;">
							<div class="col">品牌</div>
							<div class="input-value" ng-click="doSelectBrand()">{{input.brand_select.name}}</div>
						</div>
						<div class="item item-input item-select" data-tap-disabled="true" style="font-size:16px;padding:0 30px 0 10px;">
								<div class="col">店铺分类</div>
								<div class="input-value" ng-click="doSelectCat1()">{{input.cat1_select.cat_name}}</div>
							</div>
							<div class="item item-input item-select" data-tap-disabled="true" style="font-size:16px;padding:0 30px 0 10px;">
									<div class="col"></div>
									<div class="input-value" ng-click="doSelectCat2()">{{input.cat2_select.cat_name}}</div>
								</div>
				<li class="item selectItem">
					<div class="selectTitle">价格区间</div>
				</li>
				<li class="item item-borderless item-input-inset priceItem">
						<input type="text" placeholder="最低价" class="col col-40 text-center" ng-model="input.pricefrom" />
						<div class="col col-20 text-center" style="background-color: #F5F5F5;">—</div>
						<input type="text" placeholder="最高价" class="col col-40 text-center" ng-model="input.priceto" />
				</li>
			</div>
			
			<div class="row btnRow">
				<div class="col baseBtn" on-tap="colseSideMenu()">取消</div>
				<div class="col baseBtn orange" on-tap="doSearch()">确定</div>
			</div>
		</ion-side-menu>
	</ion-side-menus>
</ion-view>